]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
cleanup: Use object shorthand where possible
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 19 Aug 2019 19:06:04 +0000 (21:06 +0200)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Mon, 11 Nov 2019 19:25:14 +0000 (19:25 +0000)
ES6 allows to omit property names where they match the name of the
assigned variable, which makes code less redunant and thus cleaner.
We will soon enforce that in our eslint rules, so make sure we use
the shorthand wherever possible.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805

40 files changed:
js/extensionPrefs/main.js
js/gdm/authPrompt.js
js/gdm/loginDialog.js
js/gdm/util.js
js/misc/loginManager.js
js/misc/util.js
js/portalHelper/main.js
js/ui/altTab.js
js/ui/animation.js
js/ui/appDisplay.js
js/ui/background.js
js/ui/components/automountManager.js
js/ui/components/networkAgent.js
js/ui/components/telepathyClient.js
js/ui/ctrlAltTab.js
js/ui/dialog.js
js/ui/endSessionDialog.js
js/ui/extensionDownloader.js
js/ui/iconGrid.js
js/ui/keyboard.js
js/ui/layout.js
js/ui/lookingGlass.js
js/ui/magnifier.js
js/ui/main.js
js/ui/messageTray.js
js/ui/mpris.js
js/ui/notificationDaemon.js
js/ui/overviewControls.js
js/ui/panel.js
js/ui/popupMenu.js
js/ui/remoteSearch.js
js/ui/screenShield.js
js/ui/screenshot.js
js/ui/status/keyboard.js
js/ui/status/network.js
js/ui/unlockDialog.js
js/ui/windowManager.js
js/ui/workspace.js
js/ui/workspacesView.js
js/ui/xdndHandler.js

index 71ad86235af04f3efec3c40d7486bf5f7b9bb64c..25f3976f0c8b7824a7ac4c3a684493cafef83a19 100644 (file)
@@ -126,7 +126,7 @@ class Application extends Gtk.Application {
 
         let buffer = new Gtk.TextBuffer({ text: errortext });
         let textview = new Gtk.TextView({
-            buffer: buffer,
+            buffer,
             wrap_mode: Gtk.WrapMode.WORD,
             monospace: true,
             editable: false,
index de4bed78ad881d69231916b4a776326619c18c94..0d12e9d1ab1e6d8902099a1ea5b400e179275170 100644 (file)
@@ -64,7 +64,7 @@ var AuthPrompt = GObject.registerClass({
         else if (this._mode == AuthPromptMode.UNLOCK_OR_LOG_IN)
             reauthenticationOnly = false;
 
-        this._userVerifier = new GdmUtil.ShellUserVerifier(this._gdmClient, { reauthenticationOnly: reauthenticationOnly });
+        this._userVerifier = new GdmUtil.ShellUserVerifier(this._gdmClient, { reauthenticationOnly });
 
         this._userVerifier.connect('ask-question', this._onAskQuestion.bind(this));
         this._userVerifier.connect('show-message', this._onShowMessage.bind(this));
index 3cc4e8a64897d60b0163f3942d695709e553b5af..5c0030f78071e32021a46792420e72b870765a11 100644 (file)
@@ -1134,8 +1134,7 @@ var LoginDialog = GObject.registerClass({
         let userName = item.user.get_user_name();
         let hold = new Batch.Hold();
 
-        this._authPrompt.begin({ userName: userName,
-                                 hold: hold });
+        this._authPrompt.begin({ userName, hold });
         return hold;
     }
 
index f9f25b4be3f8e3f506be4f882290cb7267d1b829..72ec12b27b024070d35c1a931bdef84857148f8d 100644 (file)
@@ -272,7 +272,7 @@ var ShellUserVerifier = class {
         let interval = this._getIntervalForMessage(message);
 
         this.hasPendingMessages = true;
-        this._messageQueue.push({ text: message, type: messageType, interval: interval });
+        this._messageQueue.push({ text: message, type: messageType, interval });
         this._queueMessageTimeout();
     }
 
index 7c383a519fbe58a66ed2864a96e4e933ca42c551..9ddc42856aefd14f4942a27c76983c2e580080a0 100644 (file)
@@ -185,7 +185,7 @@ var LoginManagerSystemd = class {
                 try {
                     let [outVariant_, fdList] = proxy.call_with_unix_fd_list_finish(result);
                     fd = fdList.steal_fds()[0];
-                    callback(new Gio.UnixInputStream({ fd: fd }));
+                    callback(new Gio.UnixInputStream({ fd }));
                 } catch (e) {
                     logError(e, "Error getting systemd inhibitor");
                     callback(null);
index 7d5874bef3420a2f5facb6f5ced2ca0b6d2cc10b..a9194e3a0cf42e3e39161b248a308fbfb82a829c 100644 (file)
@@ -121,8 +121,7 @@ function trySpawn(argv) {
             // We are only interested in the part in the parentheses. (And
             // we can't pattern match the text, since it gets localized.)
             let message = err.message.replace(/.*\((.+)\)/, '$1');
-            throw new (err.constructor)({ code: err.code,
-                                          message: message });
+            throw new (err.constructor)({ code: err.code, message });
         } else {
             throw err;
         }
index f6124e5eff9719a9daf4c881a51086d835c98098..2c3b1726eb3a8e4aaf65956a9f69359588bd2fa9 100644 (file)
@@ -92,7 +92,7 @@ class PortalHeaderBar extends Gtk.HeaderBar {
 var PortalWindow = GObject.registerClass(
 class PortalWindow extends Gtk.ApplicationWindow {
     _init(application, url, timestamp, doneCallback) {
-        super._init({ application: application });
+        super._init({ application });
 
         this.connect('delete-event', this.destroyWindow.bind(this));
         this._headerBar = new PortalHeaderBar();
@@ -287,7 +287,7 @@ class WebPortalHelper extends Gtk.Application {
     }
 
     Authenticate(connection, url, timestamp) {
-        this._queue.push({ connection: connection, url: url, timestamp: timestamp });
+        this._queue.push({ connection, url, timestamp });
 
         this._processQueue();
     }
index 449e37143c00e4efa486acb5b684620c2df87800..cedd19855905f69ead34bb4982c324240aade470 100644 (file)
@@ -415,7 +415,7 @@ class CyclerHighlight extends St.Widget {
         this.add_actor(this._highlight);
 
         let coordinate = Clutter.BindCoordinate.ALL;
-        let constraint = new Clutter.BindConstraint({ coordinate: coordinate });
+        let constraint = new Clutter.BindConstraint({ coordinate });
         this._clone.bind_property('source', constraint, 'source', 0);
 
         this.add_constraint(constraint);
index d047b75ed021ed1dec4129ef8224253fe2722166..e2fdf489b4836b5c22db513f690fc6b46f5e0ba9 100644 (file)
@@ -10,7 +10,7 @@ var SPINNER_ANIMATION_DELAY = 1000;
 var Animation = GObject.registerClass(
 class Animation extends St.Bin {
     _init(file, width, height, speed) {
-        super._init({ width: width, height: height });
+        super._init({ width, height });
         this.connect('destroy', this._onDestroy.bind(this));
         this.connect('resource-scale-changed',
             this._loadFile.bind(this, file, width, height));
index 9193c121bed44d643fd17e2f83b32e4f85a989cf..c0cb047f064ac8b84090044abc3b4b7e3545e2d8 100644 (file)
@@ -710,7 +710,7 @@ var AllView = GObject.registerClass({
             else
                 opacity = 255;
             this._items[id].ease({
-                opacity: opacity,
+                opacity,
                 duration: INACTIVE_GRID_OPACITY_ANIMATION_TIME,
                 mode: Clutter.AnimationMode.EASE_OUT_QUAD
             });
@@ -1029,14 +1029,14 @@ class AppDisplay extends St.BoxLayout {
                                  style_class: 'app-view-control button',
                                  can_focus: true,
                                  x_expand: true });
-        this._views[Views.FREQUENT] = { 'view': view, 'control': button };
+        this._views[Views.FREQUENT] = { view, 'control': button };
 
         view = new AllView();
         button = new St.Button({ label: _("All"),
                                  style_class: 'app-view-control button',
                                  can_focus: true,
                                  x_expand: true });
-        this._views[Views.ALL] = { 'view': view, 'control': button };
+        this._views[Views.ALL] = { view, 'control': button };
 
         this._viewStackLayout = new ViewStackLayout();
         this._viewStack = new St.Widget({ x_expand: true, y_expand: true,
@@ -1472,7 +1472,7 @@ var FolderIcon = GObject.registerClass({
         this._parentView = parentView;
 
         this._folder = new Gio.Settings({ schema_id: 'org.gnome.desktop.app-folders.folder',
-                                          path: path });
+                                          path });
         this._delegate = this;
         // whether we need to update arrow side, position etc.
         this._popupInvalidated = false;
index 9302cedea82094d30fb949cb59fa3f398d2ef7b4..1953ba0342e1adad52ac52f29cc438b16c58f622 100644 (file)
@@ -444,7 +444,7 @@ var Background = GObject.registerClass({
 
     _loadAnimation(file) {
         this._cache.getAnimation({
-            file: file,
+            file,
             settingsSchema: this._settings.schema_id,
             onLoaded: animation => {
                 this._animation = animation;
@@ -592,11 +592,11 @@ var BackgroundSource = class BackgroundSource {
 
         if (!(monitorIndex in this._backgrounds)) {
             let background = new Background({
-                monitorIndex: monitorIndex,
+                monitorIndex,
                 layoutManager: this._layoutManager,
                 settings: this._settings,
-                file: file,
-                style: style
+                file,
+                style
             });
 
             background._changedId = background.connect('bg-changed', () => {
index 467829f73597a43870cc34194cef9aafbaaa956a..2df866197d0baf2bad82d228a2ece48ad4c9e78a 100644 (file)
@@ -230,7 +230,7 @@ var AutomountManager = class {
         let existingDialog = prevOperation ? prevOperation.borrowDialog() : null;
         let operation =
             new ShellMountOperation.ShellMountOperation(volume,
-                                                        { existingDialog: existingDialog });
+                                                        { existingDialog });
         this._mountVolume(volume, operation);
     }
 
index 983595ca686d92043a6b980ed37bb5bd3ac67d70..57a8b41fae4b623a7642290eb2ded018da85e772 100644 (file)
@@ -56,7 +56,7 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
 
             secret.entry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
                                           text: secret.value, can_focus: reactive,
-                                          reactive: reactive,
+                                          reactive,
                                           x_expand: true });
             ShellEntry.addContextMenu(secret.entry,
                                       { isPassword: secret.password });
@@ -553,7 +553,7 @@ var VPNRequestHandler = class {
                     contentOverride.secrets.push({
                         label: keyfile.get_string(groups[i], 'Label'),
                         key: groups[i],
-                        value: value,
+                        value,
                         password: keyfile.get_boolean(groups[i], 'IsSecret'),
                     });
                 } else {
index 4260bec21b9a5a048b16889a9e726131372b315c..90fc03ca8448cc2ce771e2e19145e91ea735daad 100644 (file)
@@ -49,10 +49,10 @@ function makeMessageFromTpMessage(tpMessage, direction) {
 
     return {
         messageType: tpMessage.get_message_type(),
-        text: text,
+        text,
         sender: tpMessage.sender.alias,
-        timestamp: timestamp,
-        direction: direction
+        timestamp,
+        direction
     };
 }
 
@@ -66,7 +66,7 @@ function makeMessageFromTplEvent(event) {
         text: event.get_message(),
         sender: event.get_sender().get_alias(),
         timestamp: event.get_timestamp(),
-        direction: direction
+        direction
     };
 }
 
@@ -350,7 +350,7 @@ class ChatSource extends MessageTray.Source {
     getIcon() {
         let file = this._contact.get_avatar_file();
         if (file)
-            return new Gio.FileIcon({ file: file });
+            return new Gio.FileIcon({ file });
         else
             return new Gio.ThemedIcon({ name: 'avatar-default' });
     }
@@ -683,10 +683,10 @@ var ChatNotification = HAVE_TP ? GObject.registerClass({
             ? 'received' : 'sent');
 
         this._append({ body: messageBody,
-                       group: group,
-                       styles: styles,
+                       group,
+                       styles,
                        timestamp: message.timestamp,
-                       noTimestamp: noTimestamp });
+                       noTimestamp });
     }
 
     _filterMessages() {
index 4b54d94108a0fa221486be08b2e7cfb22d926f16..b7b3939af9573791d42ac09e0495294fa0acda44 100644 (file)
@@ -104,7 +104,7 @@ var CtrlAltTabManager = class CtrlAltTabManager {
                                  Main.activateWindow(windows[i], timestamp);
                              },
                              iconActor: icon,
-                             iconName: iconName,
+                             iconName,
                              sortGroup: SortGroup.MIDDLE });
             }
         }
index d3b7178e0e407b8daabc86b53eac3549e1746a83..ff986055f27662174fd925b7f2ecdf8f95bbcc1e 100644 (file)
@@ -117,7 +117,7 @@ class Dialog extends St.Widget {
                                      can_focus: true,
                                      x_expand: true,
                                      y_expand: true,
-                                     label: label });
+                                     label });
         button.connect('clicked', action);
 
         buttonInfo['button'] = button;
index 319e8c764d7beeca5c17875da7f1e9d31c9802cf..c87cf59dd1bf3e76037f86e1144ec0523752aff0 100644 (file)
@@ -456,7 +456,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
                         this._confirm(signal);
                     });
                 },
-                label: label,
+                label,
             });
         }
 
index 4cf0414ddfa2ba0be362359dbe77552e5a1905f6..d4199ed2fe8d52803861ff6ab4200118c3a8efec 100644 (file)
@@ -19,7 +19,7 @@ var REPOSITORY_URL_UPDATE   = `${REPOSITORY_URL_BASE}/update-info/`;
 let _httpSession;
 
 function installExtension(uuid, invocation) {
-    let params = { uuid: uuid,
+    let params = { uuid,
                    shell_version: Config.PACKAGE_VERSION };
 
     let message = Soup.form_request_new_from_hash('GET', REPOSITORY_URL_INFO, params);
index ba769de24d18af465c32197dcf0c5bbbed3b7c6e..dbde037634bf67feff69f715cfe7b9c33243dd99 100644 (file)
@@ -487,7 +487,7 @@ var IconGrid = GObject.registerClass({
                 scale_y: ANIMATION_BOUNCE_ICON_SCALE,
                 duration: bounceUpTime,
                 mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD,
-                delay: delay,
+                delay,
                 onComplete: () => {
                     let duration = ANIMATION_TIME_IN - bounceUpTime;
                     actor.ease({
index 48c3afa1ce5be5a124473821f6191b1644c6d2b1..f51ac777625417b6a9271218a8f3e09c975ff02c 100644 (file)
@@ -404,7 +404,7 @@ var Key = GObject.registerClass({
     _makeKey(key) {
         let label = GLib.markup_escape_text(key, -1);
         let button = new St.Button({
-            label: label,
+            label,
             style_class: 'keyboard-key',
             x_expand: true,
         });
index c26dd54dec794cf68f0e117a4359ceb257dadde7..b1c3d9264681f2f272ac9798a9768f89e7f7cf4c 100644 (file)
@@ -445,7 +445,7 @@ var LayoutManager = GObject.registerClass({
     _createBackgroundManager(monitorIndex) {
         let bgManager = new Background.BackgroundManager({ container: this._backgroundGroup,
                                                            layoutManager: this,
-                                                           monitorIndex: monitorIndex });
+                                                           monitorIndex });
 
         bgManager.connect('changed', this._addBackgroundMenu.bind(this));
         this._addBackgroundMenu(bgManager);
@@ -955,7 +955,7 @@ var LayoutManager = GObject.registerClass({
     findIndexForActor(actor) {
         let [x, y] = actor.get_transformed_position();
         let [w, h] = actor.get_transformed_size();
-        let rect = new Meta.Rectangle({ x: x, y: y, width: w, height: h });
+        let rect = new Meta.Rectangle({ x, y, width: w, height: h });
         return global.display.get_monitor_index_for_rect(rect);
     }
 
@@ -1026,7 +1026,7 @@ var LayoutManager = GObject.registerClass({
             h = Math.round(h);
 
             if (actorData.affectsInputRegion && wantsInputRegion && actorData.actor.get_paint_visibility())
-                rects.push(new Meta.Rectangle({ x: x, y: y, width: w, height: h }));
+                rects.push(new Meta.Rectangle({ x, y, width: w, height: h }));
 
             let monitor = null;
             if (actorData.affectsStruts)
@@ -1077,7 +1077,7 @@ var LayoutManager = GObject.registerClass({
                 }
 
                 let strutRect = new Meta.Rectangle({ x: x1, y: y1, width: x2 - x1, height: y2 - y1 });
-                let strut = new Meta.Strut({ rect: strutRect, side: side });
+                let strut = new Meta.Strut({ rect: strutRect, side });
                 struts.push(strut);
             }
         }
index 7f83c4a8b86b54a9533093eda72b32e8447bad57..6f9a5235db431762b0bfe06ba929466cea4d32ba 100644 (file)
@@ -86,12 +86,12 @@ var AutoComplete = class AutoComplete {
             let currTime = global.get_current_time();
             if ((currTime - this._lastTabTime) < AUTO_COMPLETE_DOUBLE_TAB_DELAY) {
                 this._processCompletionRequest({ tabType: 'double',
-                                                 completions: completions,
-                                                 attrHead: attrHead });
+                                                 completions,
+                                                 attrHead });
             } else {
                 this._processCompletionRequest({ tabType: 'single',
-                                                 completions: completions,
-                                                 attrHead: attrHead });
+                                                 completions,
+                                                 attrHead });
             }
             this._lastTabTime = currTime;
         }
@@ -141,9 +141,9 @@ var Notebook = GObject.registerClass({
         scrollview.get_hscroll_bar().hide();
         scrollview.add_actor(child);
 
-        let tabData = { child: child,
-                        labelBox: labelBox,
-                        label: label,
+        let tabData = { child,
+                        labelBox,
+                        label,
                         scrollView: scrollview,
                         _scrollToBottom: false };
         this._tabs.push(tabData);
index f45d2e1241946ebb76a2ad73b46f98fce7dce5b1..e38c3a4176c68805f70ad3a1eb0f9f1bdd5acf44 100644 (file)
@@ -858,8 +858,8 @@ var ZoomRegion = class ZoomRegion {
      *                  of the magnified view.
      */
     setMagFactor(xMagFactor, yMagFactor) {
-        this._changeROI({ xMagFactor: xMagFactor,
-                          yMagFactor: yMagFactor,
+        this._changeROI({ xMagFactor,
+                          yMagFactor,
                           redoCursorTracking: this._followingCursor });
     }
 
index 5018258b0d71c517d56a78d22fad39ef7336e370..d580d56fed499ef684be2173b129680b92fab226 100644 (file)
@@ -490,11 +490,11 @@ function pushModal(actor, params) {
                 modalActorFocusStack[index].prevFocus = null;
         });
     }
-    modalActorFocusStack.push({ actor: actor,
+    modalActorFocusStack.push({ actor,
                                 destroyId: actorDestroyId,
-                                prevFocus: prevFocus,
-                                prevFocusDestroyId: prevFocusDestroyId,
-                                actionMode: actionMode });
+                                prevFocus,
+                                prevFocusDestroyId,
+                                actionMode });
 
     actionMode = params.actionMode;
     global.stage.set_key_focus(actor);
@@ -687,8 +687,8 @@ function _queueBeforeRedraw(workId) {
 function initializeDeferredWork(actor, callback) {
     // Turn into a string so we can use as an object property
     let workId = `${(++_deferredWorkSequence)}`;
-    _deferredWorkData[workId] = { 'actor': actor,
-                                  'callback': callback };
+    _deferredWorkData[workId] = { actor,
+                                  callback };
     actor.connect('notify::mapped', () => {
         if (!(actor.mapped && _deferredWorkQueue.includes(workId)))
             return;
index e8d4e55707e61a140fa0d51194dd8279c41bd835..4a62cdb6acdfb2c61bd17e3435c16fa1a42ddbe1 100644 (file)
@@ -435,7 +435,7 @@ var Notification = GObject.registerClass({
     // @label: the label for the action's button
     // @callback: the callback for the action
     addAction(label, callback) {
-        this.actions.push({ label: label, callback: callback });
+        this.actions.push({ label, callback });
     }
 
     get acknowledged() {
@@ -609,7 +609,7 @@ var NotificationBanner = GObject.registerClass({
 
     addAction(label, callback) {
         let button = new St.Button({ style_class: 'notification-button',
-                                     label: label,
+                                     label,
                                      x_expand: true,
                                      can_focus: true });
 
@@ -750,7 +750,7 @@ var Source = GObject.registerClass({
     }
 }, class Source extends GObject.Object {
     _init(title, iconName) {
-        super._init({ title: title });
+        super._init({ title });
 
         this.SOURCE_ICON_SIZE = 48;
 
index 1519e47526638d0ba81f89577c1938d4d8c0bb09..2b251546d368111aea220f6257f7906310b7df97 100644 (file)
@@ -72,7 +72,7 @@ class MediaMessage extends MessageList.Message {
 
         if (this._player.trackCoverUrl) {
             let file = Gio.File.new_for_uri(this._player.trackCoverUrl);
-            this._icon.gicon = new Gio.FileIcon({ file: file });
+            this._icon.gicon = new Gio.FileIcon({ file });
             this._icon.remove_style_class_name('fallback');
         } else {
             this._icon.icon_name = 'audio-x-generic-symbolic';
index d9be574a562dddcab18a0a331542b837c14bedea..e9109dd51dafca5cb2f50b6e7834ccd59f806c4c 100644 (file)
@@ -201,13 +201,13 @@ var FdoNotificationDaemon = class FdoNotificationDaemon {
                 hints['image-data'] = hints['icon_data'];
         }
 
-        let ndata = { appName: appName,
-                      icon: icon,
-                      summary: summary,
-                      body: body,
-                      actions: actions,
-                      hints: hints,
-                      timeout: timeout };
+        let ndata = { appName,
+                      icon,
+                      summary,
+                      body,
+                      actions,
+                      hints,
+                      timeout };
         if (replacesId != 0 && this._notifications[replacesId]) {
             ndata.id = id = replacesId;
             ndata.notification = this._notifications[replacesId].notification;
@@ -299,7 +299,7 @@ var FdoNotificationDaemon = class FdoNotificationDaemon {
         else if (!gicon)
             gicon = this._fallbackIconForNotificationData(hints);
 
-        notification.update(summary, body, { gicon: gicon,
+        notification.update(summary, body, { gicon,
                                              bannerMarkup: true,
                                              clear: true,
                                              soundFile: hints['sound-file'],
index 812abb00120a41863ba1e9f6661810aa86e7f233..a529b83251c29591ba480362d7e64e8a6ec971b1 100644 (file)
@@ -462,7 +462,7 @@ class ControlsManager extends St.Widget {
     _updateWorkspacesGeometry() {
         let [x, y] = this.get_transformed_position();
         let [width, height] = this.get_transformed_size();
-        let geometry = { x: x, y: y, width: width, height: height };
+        let geometry = { x, y, width, height };
 
         let spacing = this.get_theme_node().get_length('spacing');
         let dashWidth = this._dashSlider.getVisibleWidth() + spacing;
index 4823d75b72f0bdda363cfa52edacea9814618251..46080987ce94ec1189d8c3b6520117d47bb714e5 100644 (file)
@@ -57,8 +57,7 @@ function _unpremultiply(color) {
     let red = Math.min((color.red * 255 + 127) / color.alpha, 255);
     let green = Math.min((color.green * 255 + 127) / color.alpha, 255);
     let blue = Math.min((color.blue * 255 + 127) / color.alpha, 255);
-    return new Clutter.Color({ red: red, green: green,
-                               blue: blue, alpha: color.alpha });
+    return new Clutter.Color({ red, green, blue, alpha: color.alpha });
 }
 
 class AppMenu extends PopupMenu.PopupMenu {
index 978b3b22eb3c007ce943964634bba4709e2326e6..34e0413dddec5b588865438593ae55e259ad21bc 100644 (file)
@@ -269,7 +269,7 @@ class PopupMenuItem extends PopupBaseMenuItem {
     _init(text, params) {
         super._init(params);
 
-        this.label = new St.Label({ text: text });
+        this.label = new St.Label({ text });
         this.add_child(this.label);
         this.label_actor = this.label;
     }
@@ -330,7 +330,7 @@ var PopupSwitchMenuItem = GObject.registerClass({
     _init(text, active, params) {
         super._init(params);
 
-        this.label = new St.Label({ text: text });
+        this.label = new St.Label({ text });
         this._switch = new Switch(active);
 
         this.accessible_role = Atk.Role.CHECK_MENU_ITEM;
@@ -416,7 +416,7 @@ class PopupImageMenuItem extends PopupBaseMenuItem {
         this._icon = new St.Icon({ style_class: 'popup-menu-icon',
                                    x_align: Clutter.ActorAlign.END });
         this.add_child(this._icon);
-        this.label = new St.Label({ text: text });
+        this.label = new St.Label({ text });
         this.add_child(this.label);
         this.label_actor = this.label;
 
@@ -1129,7 +1129,7 @@ class PopupSubMenuMenuItem extends PopupBaseMenuItem {
             this.add_child(this.icon);
         }
 
-        this.label = new St.Label({ text: text,
+        this.label = new St.Label({ text,
                                     y_expand: true,
                                     y_align: Clutter.ActorAlign.CENTER });
         this.add_child(this.label);
@@ -1251,7 +1251,7 @@ var PopupMenuManager = class {
             return;
 
         let menudata = {
-            menu:              menu,
+            menu,
             openStateChangeId: menu.connect('open-state-changed', this._onMenuOpenState.bind(this)),
             destroyId:         menu.connect('destroy', this._onMenuDestroy.bind(this)),
             enterId:           0,
index b357aca74da91cb5de6d37f6202f1589f503f5c3..98aa437dd8ef34de214b80760f666612ad157d32 100644 (file)
@@ -228,8 +228,7 @@ var RemoteSearchProvider = class {
         }
 
         if (gicon)
-            icon = new St.Icon({ gicon: gicon,
-                                 icon_size: size });
+            icon = new St.Icon({ gicon, icon_size: size });
         return icon;
     }
 
index 732bb69a4fc92ae6b723ac42d2ff0ec8489d7ab0..3e5ee17e4eb3a9383c28abef262f43fa85d745c1 100644 (file)
@@ -600,7 +600,7 @@ var ScreenShield = class {
                                      height: monitor.height });
 
         let bgManager = new Background.BackgroundManager({ container: widget,
-                                                           monitorIndex: monitorIndex,
+                                                           monitorIndex,
                                                            controlPosition: false,
                                                            settingsSchema: SCREENSAVER_SCHEMA });
 
@@ -1026,8 +1026,7 @@ var ScreenShield = class {
             });
         } else {
             this._lockScreenGroup.fixed_position_set = false;
-            this._lockScreenShown({ fadeToBlack: fadeToBlack,
-                                    animateFade: false });
+            this._lockScreenShown({ fadeToBlack, animateFade: false });
         }
 
         this._lockScreenGroup.grab_key_focus();
index f57e10224b72bc6650e758c71c34a1b5bffe6236..93825f1221d55f7985d3e245f6602dde9bb3c885 100644 (file)
@@ -252,7 +252,7 @@ var ScreenshotService = class {
                                             "Invalid params");
             return;
         }
-        let flashspot = new Flashspot({ x: x, y: y, width: width, height: height });
+        let flashspot = new Flashspot({ x, y, width, height });
         flashspot.fire();
         invocation.return_value(null);
     }
index e9a4eb48e40e80dfff9d2f5a9845d6fcbabcb49f..1180e258c5b2e920300cb9aa1f7b5c6c03666e98 100644 (file)
@@ -233,7 +233,7 @@ var InputSourceSystemSettings = class extends InputSourceSettings {
             let id = layouts[i];
             if (variants[i])
                 id += `+${variants[i]}`;
-            sourcesList.push({ type: INPUT_SOURCE_TYPE_XKB, id: id });
+            sourcesList.push({ type: INPUT_SOURCE_TYPE_XKB, id });
         }
         return sourcesList;
     }
@@ -266,7 +266,7 @@ var InputSourceSessionSettings = class extends InputSourceSettings {
 
         for (let i = 0; i < nSources; i++) {
             let [type, id] = sources.get_child_value(i).deep_unpack();
-            sourcesList.push({ type: type, id: id });
+            sourcesList.push({ type, id });
         }
         return sourcesList;
     }
@@ -562,14 +562,14 @@ var InputSourceManager = class {
             }
 
             if (exists)
-                infosList.push({ type: type, id: id, displayName: displayName, shortName: shortName });
+                infosList.push({ type, id, displayName, shortName });
         }
 
         if (infosList.length == 0) {
             let type = INPUT_SOURCE_TYPE_XKB;
             let id = KeyboardManager.DEFAULT_LAYOUT;
             let [, displayName, shortName] = this._xkbInfo.get_layout_info(id);
-            infosList.push({ type: type, id: id, displayName: displayName, shortName: shortName });
+            infosList.push({ type, id, displayName, shortName });
         }
 
         let inputSourcesByShortName = {};
index 63809032071667b2621e93feffaad71f5c7211ae..3835ffbc35ba52cfc7a7887f3936b5b2f9aa3967 100644 (file)
@@ -1710,7 +1710,7 @@ class Indicator extends PanelMenu.SystemIndicator {
         this._ensureSource();
 
         let gicon = new Gio.ThemedIcon({ name: iconName });
-        this._notification = new MessageTray.Notification(this._source, title, text, { gicon: gicon });
+        this._notification = new MessageTray.Notification(this._source, title, text, { gicon });
         this._notification.setUrgency(urgency);
         this._notification.setTransient(true);
         this._notification.connect('destroy', () => {
index 077ab1fbe2264d26727af946828e4807b352ef7f..6584bea450c0229d1cd101e0eb2f6630e8c9877f 100644 (file)
@@ -95,7 +95,7 @@ var UnlockDialog = GObject.registerClass({
             userName = null;
         }
 
-        this._authPrompt.begin({ userName: userName });
+        this._authPrompt.begin({ userName });
     }
 
     _escape() {
index 8b976bdfbf018ff44f2c2461bd7166d6a685b29f..c902f5b27e4ce90da598bdbac42c1cdde0dcbb8b 100644 (file)
@@ -1466,7 +1466,7 @@ var WindowManager = class {
         this._resizePending.add(actor);
         actor.__animationInfo = { clone: actorClone,
                                   oldRect: oldFrameRect,
-                                  destroyId: destroyId };
+                                  destroyId };
     }
 
     _sizeChangedWindow(shellwm, actor) {
index 1713e7436166b478dd8994dfb5cadd8924183f57..403aa53853fa580f2fd9e4da15ac7324bc02be28 100644 (file)
@@ -1950,7 +1950,7 @@ class Workspace extends St.Widget {
             if (numColumns == lastLayout.numColumns)
                 break;
 
-            let layout = { area: area, strategy: strategy, numRows: numRows, numColumns: numColumns };
+            let layout = { area, strategy, numRows, numColumns };
             strategy.computeLayout(windows, layout);
             strategy.computeScaleAndSpace(layout);
 
index 59f2830385672460151bdebeddff98bbacf63bf3..199891e474ea896a2a43cdd5506b2613a6b9b264 100644 (file)
@@ -697,7 +697,7 @@ class WorkspacesDisplay extends St.Widget {
 
     _getMonitorIndexForEvent(event) {
         let [x, y] = event.get_coords();
-        let rect = new Meta.Rectangle({ x: x, y: y, width: 1, height: 1 });
+        let rect = new Meta.Rectangle({ x, y, width: 1, height: 1 });
         return global.display.get_monitor_index_for_rect(rect);
     }
 
@@ -766,7 +766,7 @@ class WorkspacesDisplay extends St.Widget {
         let allocation = this.allocation;
         let width = allocation.x2 - allocation.x1;
         let height = allocation.y2 - allocation.y1;
-        let primaryGeometry = { x: x, y: y, width: width, height: height };
+        let primaryGeometry = { x, y, width, height };
 
         let monitors = Main.layoutManager.monitors;
         for (let i = 0; i < monitors.length; i++) {
index 8b5297c09d971b70642605331980eea7de081b91..fc4283c11643ce8afc6fb3b23dd98bbe82800e28 100644 (file)
@@ -84,8 +84,8 @@ var XdndHandler = class {
             Main.uiGroup.set_child_above_sibling(this._cursorWindowClone, null);
 
         let dragEvent = {
-            x: x,
-            y: y,
+            x,
+            y,
             dragActor: this._cursorWindowClone ? this._cursorWindowClone : this._dummy,
             source: this,
             targetActor: pickedActor